<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Calendar" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div>
   <%
       Date time = new Date();
       SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss E");
       String now = dt.format(time);
       int hours = time.getHours();
       if (hours >= 0 && hours <= 12){
           out.print("早上好");
       }
       else if (hours >= 12 && hours < 18) {
           out.print("下午好");
       }
       else {
           out.print("晚上好");
       }
   %>
    当前时间：<%=now%>
</div>
</body>
</html>